//
//  ReusedScrollViewViewController.m
//  ReusedScrollView
//
//  Created by Haibo Tang on 11-10-20.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "ReusedScrollViewViewController.h"
#import "RecommendAppScrollView.h"

@implementation ReusedScrollViewViewController

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
#define kDataCount 10
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    RecommendAppScrollView *scrollView = [[RecommendAppScrollView alloc] initWithFrame:CGRectMake(0.f, 0.f, 320.f, 100.f)];
    scrollView.backgroundColor = [UIColor greenColor];
    NSMutableArray *array = [NSMutableArray arrayWithCapacity:10];
    for (int i=0; i<kDataCount; i++) {
        [array addObject:@""];
    }
    [scrollView setDataSource:array];
    [self.view addSubview:scrollView];
    [scrollView release];
}


- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
